//
//  YTCacheService.h
//  yangtao
//
//  Created by Tommy on 14/10/17.
//  Copyright (c) 2014年 com.taobao. All rights reserved.
//

#import "KLSingleton.h"
#import "KLICache.h"

@class RACSignal;


@interface KLCacheService : NSObject<KLICache>
KLDEC_SINGLETON(KLCacheService);

//opreations on cache
- (RACSignal*)allCahces;
- (RACSignal*)cache:(id<KLICache>)cache forKey:(NSString*)key;
- (RACSignal*)setCache:(id<KLICache>)cache forKey:(NSString*)key;
- (RACSignal*)removeCacheForKey:(NSString*)key;

//operation on cache
- (RACSignal*)clearAll;
- (RACSignal*)clearExpired:(NSDate*)date;
- (RACSignal*)objectForKey:(NSString*)key;
- (RACSignal*)setObject:(id <NSCoding>)object forKey:(NSString *)key;
- (RACSignal*)removeObjectForKey:(NSString*)key;


+ (RACSignal*)objectForKey:(NSString*)key;
+ (RACSignal*)setObject:(id<NSCoding>)data forKey:(NSString*)key;
+ (RACSignal*)removeObjectForKey:(NSString*)key;
+ (RACSignal*)clearAll;
+ (RACSignal*)clearExpired:(NSDate*)date;


@end
